package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import business.AreaAtuacaoDAO;

@Entity
@Table(name = "atua")
public class Atua implements Serializable {
	private static final long serialVersionUID = 4464726899347021435L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "atua_Seq")
	@SequenceGenerator(name = "atua_Seq", sequenceName = "atua_Seq")
	@Column(name = "id")
	private int id;
	private int ordemPreferencia;
	private int areaAtuacaoId;
	private int associadoId;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getOrdemPreferencia() {
		return ordemPreferencia;
	}
	public void setOrdemPreferencia(int ordemPreferencia) {
		this.ordemPreferencia = ordemPreferencia;
	}
	public int getAreaAtuacao() {
		return areaAtuacaoId;
	}
	public void setAreaAtuacao(int areaAtuacaoId) {
		this.areaAtuacaoId = areaAtuacaoId;
	}
	public int getAssociado() {
		return associadoId;
	}
	public void setAssociado(int associadoId) {
		this.associadoId = associadoId;
	}
	public String getAreaAtuacaoDesc() {
		AreaAtuacaoDAO areaAtuacaoDAO = new AreaAtuacaoDAO();
		return areaAtuacaoDAO.get(areaAtuacaoId).getDescricao();
	}
}
 
